let http = require('http')
let fs = require('fs')
let server = http.createServer((request,response) => {
    //1.设置跨域
    response.setHeader('Access-Cotrol-Allow-Origin','*')
    let path = '../static'
    fs.readdir(path,function(err,res){
        console.log(err)
        console.log(res)
    })
    response.end()
})

server.listen(8007,'127.0.0.1',()=>{
    console.log('server is running on 8007')
})